package com.wangdong.mijiqiqi.builder.product;

/**
 * 作者：wangdong on 2018/8/31 19:38
 * 邮箱：2100520956@qq.com
 */

/**
 * 计算机导演类,知道具体建造者建造计算机
 */
public class ComputerDirector {
    ComputerBuilder builder;

    //建造T410计算机
    public T410 constructT410(){
        builder = new T410Builder();
        builder.buildCpu();
        builder.buildRam();
        builder.buildHardDisk();
        builder.buildGraphicCard();
        builder.buildMonitor();
        builder.buildOs();
        //建造结束将产品返回供外部使用
        return (T410)builder.getResult();
    }

    //建造X201计算机
    public X201 constructX201(){
        builder = new X201Builder();
        builder.buildCpu();
        builder.buildRam();
        builder.buildHardDisk();
        //由于X201没有独立显卡,则不调用buildGraphicCard()函数
        //builder.buildGraphicCard();

        builder.buildMonitor();
        builder.buildOs();
        //建造结束将产品返回供外部使用
        return (X201)builder.getResult();
    }
}
